#include<bits/stdc++.h>
using namespace std;
int a[1000000] = {0};

int fib(int n){
    a[0] = 1; a[1] = 1;
    for(int i = 2; i < n; i++){
        a[i] = (a[i-1] + a[i-2]) % 10007;
    }
    return a[n];
}

int main(){
    int n = 0;
    // scanf("%I64d",&n);
    // printf("%I64d",fib(n-1));
    cin >> n;
    cout << fib(n);
    return 0;
}